//esta clase
package code.vista;

import java.awt.*;

public class Circulo {
	public static Color colores[] = { Color.CYAN, Color.PINK, Color.RED,
			Color.BLUE, Color.GREEN, Color.YELLOW, Color.BLACK, Color.WHITE };
	private int colorActivo;
	private int x, y, size;
	private Rectangle clickArea;
	private int numeroColores;

	public Circulo(int x, int y, int t) {
		colorActivo = 0;
		this.x = x;
		this.y = y;
		size = t;
		clickArea = new Rectangle(x, y, size, size);
	}

	public int getColor() {
		return colorActivo;
	}

	public void draw(Graphics g) {
		g.setColor(colores[colorActivo]);
		g.fillOval(x, y, size, size);
		g.setColor(Color.BLACK);
		g.drawOval(x, y, size, size);
	}

	public void cambiarColor() {
		colorActivo++;
		colorActivo = colorActivo % numeroColores;
	}

	public boolean contains(int xLocation, int yLocation) {
		return clickArea.contains(xLocation, yLocation);
	}

	public int getNumeroColores() {
		return numeroColores;
	}

	public void setNumeroColores(int numeroColores) {
		this.numeroColores = numeroColores;
	}
}
